<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
use \app\utils\Utils;
Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});

Route::get('hello/:name', 'index/hello');
Route::get('/phpinfo', 'index/phpinfo');



//usercontroller
Route::post("/auth/login", "UserController/login");
Route::get("/auth/getuserinfobyauth", "UserController/getuserinfobyauth");
Route::post("/auth/getmenu", "UserController/getmenu");


Route::post("user/list", "UserController/userList");
Route::post("user/add", "UserController/add");
Route::post("user/update", "UserController/update");
Route::post("user/del", "UserController/del");


/*文章*/
Route::post("wenzhang/list", "WenzhangController/pageList");
Route::post("wenzhang/add", "WenzhangController/add");
Route::post("wenzhang/update", "WenzhangController/update");
Route::post("wenzhang/del", "WenzhangController/del");

/*menu*/
//Route::post("menu/list", "MenuController/pageList");
//Route::post("menu/add", "MenuController/add");
//Route::post("menu/update", "MenuController/update");
//Route::post("menu/del", "MenuController/del");
//Route::get("menu/getItem", "MenuController/getItem");

Route::post("appfun/getlist", "AppFunController/pageList");
Route::post("appfun/add", "AppFunController/add");
Route::post("appfun/update", "AppFunController/update");
Route::post("appfun/del", "AppFunController/del");
Route::get("appfun/getItem", "AppFunController/getItem");

/*role*/
Route::post("role/list", "RoleController/pageList");
Route::post("role/add", "RoleController/add");
Route::post("role/update", "RoleController/update");
Route::post("role/del", "RoleController/del");
Route::get("role/getItem", "RoleController/getItem");
Route::post("role/bindMenus", "RoleController/bindMenus");
Route::post("role/getMenus", "RoleController/getMenus");
Route::post("role/bindUser", "RoleController/bindUser");
Route::post("role/getMenus", "RoleController/getMenus");

/*分类模块*/
Route::post("sysClass/list", "SysClassController/pageList");
Route::post("sysClass/add", "SysClassController/add");
Route::post("sysClass/update", "SysClassController/update");
Route::post("sysClass/del", "SysClassController/del");
Route::get("sysClass/getItem", "SysClassController/getItem");
/*字典*/
Route::post("sysDictionary/list", "SysDictionaryController/pageList");
Route::post("sysDictionary/add", "SysDictionaryController/add");
Route::post("sysDictionary/update", "SysDictionaryController/update");
Route::post("sysDictionary/del", "SysDictionaryController/del");
Route::get("sysDictionary/getItem", "SysDictionaryController/getItem");


Route::post("/sysDictionary/sysDictionaryValue/list", "SysDictionaryValueController/pageList");
Route::post("/sysDictionary/sysDictionaryValue/add", "SysDictionaryValueController/add");
Route::post("/sysDictionary/sysDictionaryValue/update", "SysDictionaryValueController/update");
Route::post("/sysDictionary/sysDictionaryValue/del", "SysDictionaryValueController/del");
Route::get("/sysDictionary/sysDictionaryValue/getItem", "SysDictionaryValueController/getItem");
Route::get("/sysDictionary/sysDictionaryValue/getvaluelistbydiscode", "SysDictionaryValueController/getvaluelistbydiscode");


/*代码生成表*/
Route::post("/gTable/list", "GTableController/pageList");
Route::post("/gTable/add", "GTableController/add");
Route::post("/gTable/update", "GTableController/update");
Route::get("/gTable/del", "GTableController/del");
Route::get("/gTable/getItem", "GTableController/getItem");
/*代码生成字段*/
Route::post("/gTable/gfield/list", "GFieldController/pageList");
Route::post("/gTable/gfield/add", "GFieldController/add");
Route::post("/gTable/gfield/update", "GFieldController/update");
Route::get("/gTable/gfield/del", "GFieldController/del");
Route::get("/gTable/gfield/getItem", "GFieldController/getItem");

/*模板*/
Route::post("/sysTemplate/list", "SysTemplateController/pageList");
Route::post("/sysTemplate/add", "SysTemplateController/add");
Route::post("/sysTemplate/update", "SysTemplateController/update");
Route::get("/sysTemplate/del", "SysTemplateController/del");
Route::get("/sysTemplate/getItem", "SysTemplateController/getItem");


/*code
1 解析ddl 生成表 生成字段
2  选择表名 给一个字段名称
*/
Route::post("gTable/paseddl", "GTableController/passddl");
Route::post("gTable/addTableWithElementList", "GTableController/addTableWithElementList");
Route::post("/gTable/zipCodeByTemplate", "GTableController/zipCodeByTemplate");


/*上传文件*/
Route::post("/file/uploadone", "FileController/uploadOne");





Route::get("/test", function () {
    Log::info("我是你的爸爸 {user}",[
        "user" =>utils::toStringBoolean(
            utils::isEmptyForArray([])
            )

    ]);
});